#include "form_welcome.h"
#include "ui_form_welcome.h"


QString LOGIN = "1";
QString DELIVERY = "2";
QString PICKUP = "3";
QString STATUS = "4";
QString BIN_NUM = "666";
QString ServerIp = "123.57.35.104";
//QString ServerIp = "192.168.0.134";
//QString ServerIp = "47.105.58.250";
//QString ServerIp = "172.31.134.42";
QString Port = "8888";
//"192.168.43.41", 8888

Form_welcome::Form_welcome(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form_welcome)
{
    ui->setupUi(this);

    time_clock = new QTimer(this);
    connect(time_clock, SIGNAL(timeout()), this, SLOT(get_system_time()));
    time_clock->start(1000);


    connect(&fpu, SIGNAL(return_welcome()), this, SLOT(pickup_to_welcome_Slot()));
    connect(&fl, SIGNAL(return_welcome()), this, SLOT(exchangeWidgetSlot()));

}

Form_welcome::~Form_welcome()
{
    delete ui;
}
#if 1
void Form_welcome::get_system_time()
{
    datetime = new QDateTime(QDateTime::currentDateTime());
    QString str = datetime->toString("    yyyy-MM-dd hh:mm:ss ddd");
    ui->time_date->setText(str);

}
#endif

void Form_welcome::pickup_to_welcome_Slot()
{
    this->show();
    fpu.hide();
}

void Form_welcome::exchangeWidgetSlot()
{
    this->show();
    fl.hide();
}

void Form_welcome::on_pickup_btn_clicked()
{
    this->hide();
    fpu.show();
}

void Form_welcome::on_delivery_btn_clicked()
{
    this->hide();
    fl.show();
}
